﻿namespace WMS6.Web.Configuration
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class BomQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlBomDescrOper;
        protected DropDownList ddlIsActive;
        protected DropDownList ddlIsActiveOper;
        protected DropDownList ddlOwnerIDOper;
        protected DropDownList ddlSkuID;
        protected HtmlForm F2120;
        protected HtmlInputHidden hdnActionID;
        protected Label lblArea;
        protected Label lblBomDescr;
        protected Label lblIsActive;
        protected Label lblOwnerID;
        protected Label lblSkuID;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtBomDescr;
        protected TextBox txtOwnerID;
        protected TextBox txtSkuID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("BomList.aspx", false);
        }

        private void LoadDropDownList()
        {
            base.InitQueryDDL(this.ddlBomDescrOper, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlOwnerIDOper, 0);
            base.InitQueryDDL(this.ddlIsActiveOper, 0);
            base.InitIsActiveDDL(this.ddlIsActive, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDropDownList();
            }
        }

        public string BomRemark
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtBomDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtBomDescr.Text.Trim(), this.ddlBomDescrOper.SelectedValue);
                }
                return "";
            }
        }

        public string IsActive
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlIsActive.SelectedValue))
                {
                    return base.GetParamsString(this.ddlIsActive.SelectedValue, this.ddlIsActiveOper.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }
    }
}

